package com.gticket.cinemauser.service.impl;

import com.gticket.cinemauser.mapper.RoleMapper;
import com.gticket.cinemauser.pojo.Role;
import com.gticket.cinemauser.pojo.Users;
import com.gticket.cinemauser.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {

    @Resource
    private RoleMapper roleMapper;
    /**
     * 根据用户名查询对应角色
     * @param user user对象
     * @return role对象
     */
    @Override
    public Role selectRoleByUser_name(Users user) {
        Role role = null;
        //查询用户对应角色
        role = roleMapper.selectRolesByUser_name(user);

        return role;
    }
}
